package lt.marsrutai.mobile.android.service;

import lt.marsrutai.mobile.android.model.enums.TransportType;
import android.graphics.drawable.Drawable;

/**
 * <p>Resolves various transport related information</p>
 * 
 * @author Justas
 *
 */
public interface TransportInfoResolver {

    /**
     * <p>Resolves icon  of a particular transport with identified by it's id and
     * belonging to the provided <code>scope</code>
     * 
     * @param transportId
     * @return
     */
    Drawable resolveTransportIcon(String scopeFolder, String transportId);

    /**
     * Resolves color of a particular transport with identified by it's id and
     * belonging to the provided <code>scope</code>
     * 
     * @param scope
     * @param transportId
     * @return
     */
    int resolveTransportColor(String scope, String transportId);

    /**
     * Resolves plural name of a particular transport identified by it's id and
     * belonging to the provided <code>scope</code>
     * 
     * @param scope
     * @param transportId
     * @return
     */
    String resolveTransportPluralName(String scopeFolder, String transportId);

    /**
     * Stores transport info
     * 
     * @param transportInfo
     */
    void addTransportInfo(TransportInfo transportInfo);
    
    /**
     * Returns transport info
     * 
     * @param scopeFolder
     * @param transportId
     * @return
     */
    TransportInfo getTransportInfo(String scopeFolder, String transportId);

    /**
     * Transport related information
     * 
     * @author Justas
     */
    public static class TransportInfo {

        /** Scope to which this transport belongs */
        private String scopeFolder;
        /** transport id */
        private String transportId;
        /** Localized plural name of this transport */
        private TransportType transportType;
        /** Localized plural name of this transport */
        private String localizedNamePlural;
        /** Icon representation of this transport */
        private Drawable icon;
        /** Color representation of this transport */
        private Integer color;
        /** API: position in transport list */
        private int index;

        public TransportInfo(String scopeFolder, String transportId, TransportType transportType, String localizedNamePlural, int color, int index) {
            this.scopeFolder = scopeFolder;
            this.transportId = transportId;
            this.transportType = transportType;
            this.localizedNamePlural = localizedNamePlural;
            this.color = color;
            this.index = index;
        }

        public String getScopeFolder() {
            return scopeFolder;
        }

        public void setScopeFolder(String scopeFolder) {
            this.scopeFolder = scopeFolder;
        }

        public TransportType getTransportType() {
            return transportType;
        }

        public void setTransportType(TransportType transportType) {
            this.transportType = transportType;
        }

        public String getLocalizedNamePlural() {
            return localizedNamePlural;
        }

        public void setLocalizedNamePlural(String localizedNamePlural) {
            this.localizedNamePlural = localizedNamePlural;
        }

        public Drawable getIcon() {
            return icon;
        }

        public void setIcon(Drawable icon) {
            this.icon = icon;
        }

        public Integer getColor() {
            return color;
        }

        public void setColor(Integer color) {
            this.color = color;
        }

        public String getTransportId() {
            return transportId;
        }

        public void setTransportId(String transportId) {
            this.transportId = transportId;
        }

        public int getIndex() {
            return index;
        }

        public void setIndex(int index) {
            this.index = index;
        }

    }
}
